﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Web;
using ChinapnrAPI;
using DTCash.Redis;
using Newtonsoft.Json;
using RabbitMQCommon;
using ServiceStack.Common.Web;
using Uranus.Service.PaymentService;
using Uranus.Service.UserService;
using UserTransferStatus = Uranus.Service.PaymentService.UserTransferStatus;

namespace Uranus.ChinaService.Receives
{
    public class TransferReceive : BaseReceive
    {
        public TransferReceive(HttpContext httpContext)
            : base(httpContext)
        {

        }

        #region 投标回调

        /// <summary>
        /// 投标回调处理锁
        /// </summary>
        private static object LockInitiativeTender = new object();

        /// <summary>
        /// 投标回调处理
        /// </summary>
        public void InitiativeTender()
        {
            try
            {
                ChinapnrTransaction chinapnrTransaction = new ChinapnrTransaction();
                if (chinapnrTransaction.VerInitiativeTender(this.Request))
                {
                    int userid = Common.Validates.GetInt(this.MerPriv.Split('|')[0]);
                    Service.PaymentService.UserTransferResponse userTransferResponse =
                        Service.Payment.GetPayment().GetUserTransferById(int.Parse(this.OrdId));

                    if (userTransferResponse.Code == 1 &&
                        (userTransferResponse.UserTransfer.UserTransferStatusID == UserTransferStatus.Succeed ||
                         userTransferResponse.UserTransfer.UserTransferStatusID == UserTransferStatus.Failed))
                    {
                        if (Response.IsClientConnected) this.Response.Write("RECV_ORD_ID_" + this.OrdId);
                        return;
                    }
                    //投标
                    BuyCallBackResponse huiFuOperationLogIdResponse = Service.Payment.GetPayment()
                        .BuyCallBack(new BuyCallBackRequest()
                        {
                            UserTransferStatusID = UserTransferStatus.Succeed,
                            UserTransferID = int.Parse(this.OrdId),
                            ExtendValue = this.FreezeTrxId
                        });

                    if (huiFuOperationLogIdResponse.Code == 1)
                    {
                        string result = string.Format("订单号:{0} 成功投标 投标用户:{1} 投标金额:{2} 冻结流水id:{3} ",
                            chinapnrTransaction.OrdId, chinapnrTransaction.UsrCustId, chinapnrTransaction.TransAmt,
                            chinapnrTransaction.FreezeTrxId);

                        WriteInfoLog("投标回调执行成功", "投标回调执行成功");
                    }
                    else
                    {
                        string result = string.Format("订单号:{0},后台处理失败,失败内容:{1}", this.OrdId, huiFuOperationLogIdResponse.ResposeData);
                        WriteInfoLog("投标回调WCF处理失败", result);
                        if (huiFuOperationLogIdResponse.CheckResult != Service.PaymentService.CheckUserTransferResult.CurrentStatusIsSucceed && huiFuOperationLogIdResponse.CheckResult != Service.PaymentService.CheckUserTransferResult.CurrentStatusIsFailed)
                            WriteErrorLog("汇付天下WebService投标接口投标失败", string.Format("【服务器IP】:{0}\r\n【服务器名】:{1}\r\n{2}", ChinaServiceCommon.ServerIp, ChinaServiceCommon.ServerName, result), null, true);
                    }
                }
                else
                {
                    if (this.RespCode == "999" || this.RespCode == "099" || this.RespCode == "322" || this.RespCode == "534" || this.RespCode == "315")
                    {
                        return;
                    }
                    BuyCallBackResponse huiFuOperationLogIdResponse = Service.Payment.GetPayment()
                        .BuyCallBack(new BuyCallBackRequest()
                        {
                            UserTransferStatusID = UserTransferStatus.Failed,
                            UserTransferID = int.Parse(this.OrdId),
                            ExtendValue = this.FreezeTrxId
                        });

                    string result = string.Format("投标失败 投标用户:{0},订单ID（OrdId）:{1} 投标金额:{2} 日志序列号:{3} 失败原因:{4}", this.UsrCustId, this.OrdId, this.TransAmt, this.CurrentSeqCode, this.RespDesc);
                    WriteErrorLog("用户投标回调验证失败", result, null, true);
                }
            }
            catch (Exception ex)
            {
                WriteErrorLog("执行投标回调出现异常", Common.CodeCommon.UrlDeCode(ex.ToString()), null, true);
            }
        }

        #endregion

        #region 充值回调

        /// <summary>
        /// 用户充值回调处理锁
        /// </summary>
        private static object LockNetSave = new object();

        /// <summary>
        /// 用户充值回调
        /// </summary>
        public void NetSave()
        {
            try
            {
                int userid = Common.Validates.GetInt(this.MerPriv.Split('|')[0]);
                if (userid == 0)
                {
                    Response.Write("RECV_ORD_ID_" + this.OrdId);
                    WriteErrorLog("用户充值回调失败", string.Format("商户私有域用户ID获取失败，UsrCustId：{0},订单号：{1}", this.UsrCustId, this.OrdId));
                    return;
                }
                Service.PaymentService.UserTransferResponse huiFu = Service.Payment.GetPayment()
                        .GetUserTransferById(int.Parse(this.OrdId));
                if (huiFu.Code == 1 &&
                    (huiFu.UserTransfer.UserTransferStatusID == UserTransferStatus.Succeed ||
                     huiFu.UserTransfer.UserTransferStatusID == UserTransferStatus.Failed))
                {
                    if (this.RespCode == "000" &&
                        huiFu.UserTransfer.UserTransferStatusID == UserTransferStatus.Failed)
                    {
                        NetSaveQu();

                    }
                    if (Response.IsClientConnected) this.Response.Write("RECV_ORD_ID_" + this.OrdId);
                    return;
                }
                ChinapnrTransaction chinapnrTransaction = new ChinapnrTransaction();
                if (!chinapnrTransaction.VerNetSave(this.Request))
                {
                    if (this.RespCode == "448")
                    {
                        return;
                    }
                    WriteErrorLog("用户充值回调验证失败", string.Format("RespCode:{0},RespDesc:{1},订单号:{2},userid:{3}", this.RespCode, this.RespDesc, this.OrdId, userid));
                    chinapnrTransaction.MerPriv = Common.CodeCommon.UrlUtilityDeCode(chinapnrTransaction.MerPriv);
                    NetSaveQu();
                    return;
                }


                ChargeCallBackResponse chargeCallBackResponse = Service.Payment.GetPayment()
                    .ChargeCallBack(new ChargeCallBackRequest()
                    {
                        UserTransferStatusID = UserTransferStatus.Succeed,
                        UserTransferID = int.Parse(this.OrdId),
                    });
                if (chargeCallBackResponse.Code != 1)
                {
                    string result = string.Format("用户ID:{0}充值成功 后台失败 充值金额:{1} 充值ID：{2} 失败原因：{3}", userid, this.TransAmt, this.OrdId, chargeCallBackResponse.ResposeData);

                    WriteInfoLog("充值回调执行失败", result);
                    //ChinaServiceCommon.WriteInfoLog(System.Reflection.MethodBase.GetCurrentMethod(), result);
                    if (chargeCallBackResponse.CheckResult != Service.PaymentService.CheckUserTransferResult.CurrentStatusIsSucceed && chargeCallBackResponse.CheckResult != Service.PaymentService.CheckUserTransferResult.CurrentStatusIsFailed)
                        WriteErrorLog("汇付天下WebService充值接口充值失败", string.Format("【服务器IP】:{0}\r\n【服务器名】:{1}\r\n{2}", ChinaServiceCommon.ServerIp, ChinaServiceCommon.ServerName, result), null, true);

                    NetSaveQu();
                    return;
                }

                //CacheRedis.DelCacheKeys(CacheItem.Init(userid.ToString()).User.Message);
                //CacheRedis.DelCacheKeys(CacheItem.Init(userid.ToString()).User.Price);
                //CacheRedis.DelCacheKeys(CacheItem.Init(userid.ToString()).User.Info);

                string sucResult = string.Format("用户ID:{0} 充值成功 充值金额:{1} 订单ID：{2}", userid, this.TransAmt, this.OrdId);
                WriteInfoLog("用户充值回调后台处理", sucResult);

            }
            catch (Exception ex)
            {
                WriteErrorLog("用户充值回调出现异常", ex.ToString());
            }
        }

        private void NetSaveQu()
        {
            Dictionary<string, object> dictionary = new Dictionary<string, object>();
            dictionary.Add("cmdid", "netsave");
            dictionary.Add("logid", int.Parse(this.OrdId));
            RabbitMQConfig defaultConfig = RabbitMQConfigManagement.GetDefaultConfig();
            defaultConfig.queuename = "transfercallbackmq";
            defaultConfig.routingKey = "uranustransfercallback";
            RabitMQHandler.AddQueue<Dictionary<string, object>>(dictionary, defaultConfig);
        }

        #endregion

        #region 提现回调

        /// <summary>
        /// 用户提现回调处理锁
        /// </summary>
        private static object LockCash = new object();

        /// <summary>
        /// 用户提现回调处理
        /// </summary>
        public void Cash()
        {
            try
            {
                Service.PaymentService.UserTransferResponse huiFu =
                    Service.Payment.GetPayment().GetUserTransferById(int.Parse(this.OrdId));
                if (huiFu.Code == 1 &&
                    (huiFu.UserTransfer.UserTransferStatusID == UserTransferStatus.Succeed ||
                     huiFu.UserTransfer.UserTransferStatusID == UserTransferStatus.Failed))
                {
                    if (Response.IsClientConnected) this.Response.Write("RECV_ORD_ID_" + this.OrdId);
                    return;
                }
                ChinapnrTransaction chinapnrTransaction = new ChinapnrTransaction();
                if (!chinapnrTransaction.VerCash(this.Request))
                {
                    WriteErrorLog("用户提现回调验证失败", string.Format("OrdId:{0},UsrCustId:{1}", this.OrdId, this.UsrCustId));
                    CashQu();
                    //将信息保存到redis  下次获取 取手续费直接使用
                    // CacheRedis.AddCache(new TimeSpan(30, 0, 0, 0), CacheItem.InitByIdentity(this.OrdId, "cashfee").Other.other.HideExt(), dictionary);
                    return;
                }

                CashCallBackResponse cashCallBackResponse =
                    Service.Payment.GetPayment().CashCallBack(new CashCallBackRequest()
                    {
                        UserTransferStatusID = UserTransferStatus.Succeed,
                        UserTransferID = int.Parse(this.OrdId),
                    });
                if (cashCallBackResponse.Code != 1)
                {
                    string result =
                        string.Format(
                            "订单号:{0} 成功取现 后台失败 入账账户:{1}  入账金额:{2} 手续费:{3} 手续费扣款账户号:{4} 手续费扣款子账户:{5} 商户收取服务费金额:{6} 商户子帐户号:{7} 开户银行账号:{8}  开户银行代号:{9} 失败原因:{10}",
                            this.OrdId, this.InCustId, this.TransAmt, this.FeeAmt, this.FeeCustId, this.FeeAcctId,
                            this.ServFee, this.ServFeeAcctId, this.OpenAcctId, this.OpenBankId, cashCallBackResponse.ResposeData);
                    WriteInfoLog("取现回调处理失败", result);
                    CashQu();
                    //if (cashCallBackResponse.CheckResult != Service.PaymentService.CheckUserTransferResult.CurrentStatusIsSucceed &&
                    //    cashCallBackResponse.CheckResult != Service.PaymentService.CheckUserTransferResult.CurrentStatusIsFailed)
                    //{
                    //    WriteErrorLog("汇付天下WebService取现接口取现失败", string.Format("【服务器IP】:{0}\r\n【服务器名】:{1}\r\n{2}", ChinaServiceCommon.ServerIp, ChinaServiceCommon.ServerName, result));
                    //}
                    return;
                }
                string sucResult =
                    string.Format(
                        "订单号:{0} 成功取现 入账账户:{1}  入账金额:{2} 手续费:{3} 手续费扣款账户号:{4} 手续费扣款子账户:{5} 商户收取服务费金额:{6} 商户子帐户号:{7} 开户银行账号:{8}  开户银行代号:{9}",
                        this.OrdId, this.InCustId, this.TransAmt, this.FeeAmt, this.FeeCustId, this.FeeAcctId,
                        this.ServFee, this.ServFeeAcctId, this.OpenAcctId, this.OpenBankId);

                WriteInfoLog("取现回调处理成功", sucResult);
            }
            catch (Exception ex)
            {
                WriteErrorLog("用户提现回调出现异常", ex.ToString());
            }
        }

        /// <summary>
        /// 取现入队校验
        /// </summary>
        private void CashQu()
        {
            Dictionary<string, object> dictionary = new Dictionary<string, object>();
            dictionary.Add("cmdid", "cash");
            dictionary.Add("logid", int.Parse(this.OrdId));
            RabbitMQConfig defaultConfig = RabbitMQConfigManagement.GetDefaultConfig();
            defaultConfig.queuename = "transfercallbackmq";
            defaultConfig.routingKey = "uranustransfercallback";
            RabitMQHandler.AddQueue<Dictionary<string, object>>(dictionary, defaultConfig);
        }

        #endregion

        /// <summary>
        /// 异步回调处理
        /// </summary>
        public void AsyncCash()
        {
            if (string.IsNullOrEmpty(this.OrdId))
            {
                return;
            }
            Service.PaymentService.UserTransferResponse huiFu =
                Service.Payment.GetPayment().GetUserTransferById(int.Parse(this.OrdId));
            if (huiFu.Code == 1)
            {
                if (huiFu.UserTransfer.UserTransferStatusID == UserTransferStatus.Succeed && this.RespCode != "000")
                {
                    bool transSuccess = false;
                    string url = new ChinapnrQuery().QueryTransDetail(this.OrdId, QueryTransTypeEnmu.CASH, "");
                    BaseChinapnr baseChinapnr =
                        JsonConvert.DeserializeObject<BaseChinapnr>(Common.RequestCommon.SimulationHttp(url, "", "get"));
                    if (baseChinapnr != null && baseChinapnr.RespCode == "000")
                    {
                        if (baseChinapnr.TransStat == "H") baseChinapnr.TransStat = "S";
                        transSuccess = baseChinapnr.TransStat.ToLower() == "s";
                    }
                    if (!transSuccess)
                    {
                        Uranus.Service.PaymentService.BaseResponse baseResponse = Uranus.Service.Payment
                            .GetPayment()
                            .RepairCashResultFailTransfer(huiFu.UserTransfer.UserTransferID);
                        if (baseResponse.Code == 1)
                        {
                            DTCash.Logger.LogHelper.WriteLogInfo("用户取现数据先成功后失败--修复成功",
                                $"修复成功，UserID:{huiFu.UserTransfer.UserID}，UserTransferID:{huiFu.UserTransfer.UserTransferID}，RespCode:{this.RespCode}，RespDesc:{this.RespDesc}",
                                true);
                        }
                        else
                        {
                            DTCash.Logger.LogHelper.WriteLogInfo("用户取现数据先成功后失败--修复失败",
                                $"失败原因：{baseResponse.ResposeData}，UserID:{huiFu.UserTransfer.UserID}，UserTransferID:{huiFu.UserTransfer.UserTransferID}，RespCode:{this.RespCode}，RespDesc:{this.RespDesc}",
                                true);
                        }
                    }
                    else
                    {
                        DTCash.Logger.LogHelper.WriteLogInfo("用户取现数据先成功后失败--修复失败",
                            $"查询汇付取现交易状态是成功需手动检查数据，UserID:{huiFu.UserTransfer.UserID}，UserTransferID:{huiFu.UserTransfer.UserTransferID}，RespCode:{this.RespCode}，RespDesc:{this.RespDesc}",
                            true);
                    }
                }
                else if ((huiFu.UserTransfer.UserTransferStatusID == UserTransferStatus.Failed) && this.RespCode == "000")
                {
                    CashQu();
                    DTCash.Logger.LogHelper.WriteLogInfo("用户取现交易需要人工检查 先失败后成功--", string.Format("ordid：{0},respcode:{1},statusid:{2} 已入队处理，请手动检查修复结果", this.OrdId, this.RespCode, 3), true);
                }
                else if (huiFu.UserTransfer.UserTransferStatusID == UserTransferStatus.New &&
                            this.RespCode == "000")
                {
                    DTCash.Logger.LogHelper.WriteLogInfo("用户取现AsyncCash处理",
                        $"该笔提现从未被处理，已在当前请求处理，请手动查询处理结果，UserID:{huiFu.UserTransfer.UserID}，UserTransferID:{huiFu.UserTransfer.UserTransferID}，RespCode:{this.RespCode}，RespDesc:{this.RespDesc}",
                        true);
                    CashCallBackResponse cashCallBackResponse =
                        Service.Payment.GetPayment().CashCallBack(new CashCallBackRequest()
                        {
                            UserTransferStatusID = UserTransferStatus.Succeed,
                            UserTransferID = int.Parse(this.OrdId),
                        });
                }
                else
                {
                    CashQu();
                }
            }
        }

        #region 商户代取现

        /// <summary>
        /// 商户代取现回调处理锁
        /// </summary>
        private static object LockMerCash = new object();

        /// <summary>
        /// 商户代取现回调处理
        /// </summary>
        public void MerCash()
        {
            try
            {
                Service.PaymentService.UserTransferResponse huiFu = Service.Payment.GetPayment().GetUserTransferById(int.Parse(this.OrdId));
                if (huiFu.Code == 1 &&
                    (huiFu.UserTransfer.UserTransferStatusID == UserTransferStatus.Succeed ||
                     huiFu.UserTransfer.UserTransferStatusID == UserTransferStatus.Failed))
                {
                    if (Response.IsClientConnected) this.Response.Write("RECV_ORD_ID_" + this.OrdId);
                    return;
                }
                ChinapnrTransaction chinapnrTransaction = new ChinapnrTransaction();
                if (!chinapnrTransaction.VerMerCash(this.Request))
                {
                    Dictionary<string, object> dictionary = new Dictionary<string, object>();
                    dictionary.Add("cmdid", "cash");
                    dictionary.Add("logid", int.Parse(this.OrdId));
                    RabbitMQConfig defaultConfig = RabbitMQConfigManagement.GetDefaultConfig();
                    defaultConfig.queuename = "transfercallbackmq";
                    defaultConfig.routingKey = "uranustransfercallback";
                    RabitMQHandler.AddQueue<Dictionary<string, object>>(dictionary, defaultConfig);
                    Thread.Sleep(5000);
                    
                    return;
                }

                CashCallBackResponse cashCallBackResponse =
                    Service.Payment.GetPayment().CashCallBack(new CashCallBackRequest()
                    {
                        UserTransferStatusID = UserTransferStatus.Succeed,
                        UserTransferID = int.Parse(this.OrdId),
                    });
                if (cashCallBackResponse.Code != 1)
                {
                    string result =
                        string.Format(
                            "订单号:{0} 商户代取现成功 后台失败 入账账户:{1}  入账金额:{2} 手续费:{3} 手续费扣款账户号:{4} 手续费扣款子账户:{5} 商户收取服务费金额:{6} 商户子帐户号:{7} 开户银行账号:{8}  开户银行代号:{9} 失败原因:{10}",
                            this.OrdId, this.InCustId, this.TransAmt, this.FeeAmt, this.FeeCustId, this.FeeAcctId,
                            this.ServFee, this.ServFeeAcctId, this.OpenAcctId, this.OpenBankId, cashCallBackResponse.ResposeData);
                    WriteInfoLog("商户代取现回调处理失败", result);

                    if (cashCallBackResponse.CheckResult != Service.PaymentService.CheckUserTransferResult.CurrentStatusIsSucceed &&
                        cashCallBackResponse.CheckResult != Service.PaymentService.CheckUserTransferResult.CurrentStatusIsFailed)
                    {
                        WriteErrorLog("汇付天下WebService商户代取现接口取现失败", string.Format("【服务器IP】:{0}\r\n【服务器名】:{1}\r\n{2}", ChinaServiceCommon.ServerIp, ChinaServiceCommon.ServerName, result));
                    }
                    return;
                }
                string sucResult =
                    string.Format(
                        "订单号:{0} 商户代取现成功 入账账户:{1}  入账金额:{2} 手续费:{3} 手续费扣款账户号:{4} 手续费扣款子账户:{5} 商户收取服务费金额:{6} 商户子帐户号:{7} 开户银行账号:{8}  开户银行代号:{9}",
                        this.OrdId, this.InCustId, this.TransAmt, this.FeeAmt, this.FeeCustId, this.FeeAcctId,
                        this.ServFee, this.ServFeeAcctId, this.OpenAcctId, this.OpenBankId);

                WriteInfoLog("商户代取现回调处理成功", sucResult);

            }
            catch (Exception ex)
            {

            }
        }

        #endregion

        #region 冻结

        /// <summary>
        /// 冻结
        /// </summary>
        /// <returns></returns>
        public void UsrFreezeBg()
        {
            ChinapnrTransaction chinapnrTransaction = new ChinapnrTransaction();
            try
            {
                if (chinapnrTransaction.VerUsrFreezeBg(Request))
                {
                    WriteInfoLog("冻结回调成功", string.Format("用户汇付天下ID：{0},成功冻结金额:{1}", this.UsrCustId, this.TransAmt));

                    if (Response.IsClientConnected)
                        this.Response.Write("RECV_ORD_ID_" + this.OrdId);
                }
                else
                {
                    string content = string.Format("用户汇付天下ID：{0},冻结金额:{1},失败 失败原因:{2}", this.UsrCustId, this.TransAmt, this.RespDesc);
                    WriteInfoLog("冻结回调失败", content);
                    WriteErrorLog("汇付天下WebService冻结接口冻结失败", string.Format("【服务器IP】:{0}\r\n【服务器名】:{1}\r\n{2}", ChinaServiceCommon.ServerIp, ChinaServiceCommon.ServerName, content));
                }

            }
            catch (Exception ex)
            {
                WriteErrorLog("冻结回调验证失败", ex.ToString());
            }
        }

        #endregion

        #region 解冻

        /// <summary>
        /// 解冻
        /// </summary>
        /// <returns></returns>
        public void UsrUnFreeze()
        {
            ChinapnrTransaction chinapnrTransaction = new ChinapnrTransaction();
            try
            {
                if (chinapnrTransaction.VerUsrUnFreeze(Request))
                {
                    WriteInfoLog("解冻回调成功", string.Format("订单号:{0} 成功解冻账户:{1} 解冻流水:{2}", this.OrdId, this.UsrCustId, this.TrxId));

                    if (Response.IsClientConnected)
                        this.Response.Write("RECV_ORD_ID_" + this.OrdId);
                }
                else
                {
                    string content = string.Format("订单号:{0} 解冻失败 账户:{1} 解冻流水:{2}", this.OrdId, this.UsrCustId, this.TrxId);
                    WriteInfoLog("解冻回调失败", content);
                    WriteErrorLog("汇付天下WebService解冻接口解冻失败", string.Format("【服务器IP】:{0}\r\n【服务器名】:{1}\r\n{2}", ChinaServiceCommon.ServerIp, ChinaServiceCommon.ServerName, content));
                }

            }
            catch (Exception ex)
            {
                WriteErrorLog("解冻回调验证失败", ex.ToString());
            }
        }

        #endregion

        #region 解绑快捷卡

        private static object PnrUsrUnBindExpressCardLock = new object();
        /// <summary>
        /// 解绑快捷卡
        /// </summary>
        /// <returns></returns>
        public void PnrUsrUnBindExpressCard()
        {
            try
            {
                lock (PnrUsrUnBindExpressCardLock)
                {
                    if (this.RespCode == "000")
                    {
                        UserResponse userResponse = Uranus.Service.User.GetUser().GetUserDtoByHuiFuCode(this.CustId);
                        if (userResponse.Code == 1 && userResponse.UserDto.UserID > 0)
                        {
                            Uranus.Service.Payment.GetPayment().UnbundlingCallBack(new UnbundlingCallBackRequest()
                            {
                                UserID = userResponse.UserDto.UserID
                            });
                            WriteInfoLog("解绑快捷卡成功", string.Format(" 成功解绑快捷卡账户:{0} 银行卡号:{1} 卡号:{2} 快捷标志:{3}", this.CustId, this.BankId, this.CardId, this.ExpressFlag));

                            if (Response.IsClientConnected)
                                this.Response.Write("RECV_ORD_ID_" + this.OrdId);
                        }
                    }
                    else
                    {
                        string content = string.Format(" 成功解绑快捷卡账户:{0} 银行卡号:{1} 卡号:{2} 快捷标志:{3}", this.CustId, this.BankId, this.CardId, this.ExpressFlag);
                        WriteInfoLog("解冻回调失败", content);
                        WriteErrorLog("汇付天下WebService解冻接口解冻失败", string.Format("【服务器IP】:{0}\r\n【服务器名】:{1}\r\n{2}", ChinaServiceCommon.ServerIp, ChinaServiceCommon.ServerName, content));
                    }
                }

            }
            catch (Exception ex)
            {
                WriteErrorLog("解冻回调验证失败", ex.ToString());
            }
        }

        #endregion
    }
}